]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/network: Only show custom wired names
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 6 Feb 2023 11:22:48 +0000 (08:22 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 6 Feb 2023 11:22:48 +0000 (08:22 -0300)
Thanks to NetworkManager's connection name disambiguation, it's
pretty common for single wired connections to be named "Wired". This
is fine and what we want almost all times, but in the specific case
of quick settings, we already have a "Wired" string set as title of
the quick settings toggle, so having that as subtitle is reduntant.

Hide the subtitle label (by returning null) when the subtitle of
a wired network matches the title.

Fixes ab10b95d2dc6bda1fc0fcc3b451e535f2fc160a8
Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6369

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2627>

js/ui/status/network.js

index 28e3d70a2dfe46eb7ff47b21903c920678de0add..d3297a50486a4c0d8e775f75c9e9ad3da7d5dfb7 100644 (file)
@@ -1821,6 +1821,13 @@ class NMWiredToggle extends NMDeviceToggle {
             'gnome-network-panel.desktop');
     }
 
+    _transformSubtitle(source) {
+        const subtitle = super._transformSubtitle(source);
+        if (subtitle === this.title)
+            return null;
+        return subtitle;
+    }
+
     _createDeviceMenuItem(device) {
         return new NMWiredDeviceItem(this._client, device);
     }